import fetch from '@/utils/request';

const API_SHARE_URL = '/api/user/sale/share';
/**
 * 分享API对象
 * @module ShareApi
 */
const ShareApi = {
	/**
	 * @function customer
	 * @description 分享招募顾客海报
	 * @param  {Object} posterId 海报对象Id
	 */
	customer: (posterId) => fetch.request({
		url: `${API_SHARE_URL}/customer`,
		method: 'POST',
		data: {
			posterId: posterId,
		},
	}),
	/**
	 * @function saler
	 * @description 分享招募分销员海报
	 * @param  {Object} posterId 海报对象Id
	 */
	saler: (posterId) => fetch.request({
		url: `${API_SHARE_URL}/saler`,
		method: 'POST',
		data: {
			posterId: posterId,
		},
	}),
	/**
	 * @function product
	 * @description 分享商品海报
	 * @param  {Object} productId 分享商品对象Id
	 */
	product: (productId) => fetch.request({
		url: `${API_SHARE_URL}/product`,
		method: 'POST',
		data: {
			productId: productId,
		},
	}),
};
export default ShareApi;